package com.zshield.util;

import com.zshield.config.KafkaConfig;
import org.apache.log4j.Logger;

import java.io.File;
import java.io.IOException;

public class MarkUpgrade {
    private File f = new File("/var/log/kstream/upgrade_finished_mark");
    private static final Logger logger = Logger.getLogger(MarkUpgrade.class);

    public void createFile() {
        try {
            f.createNewFile();
        } catch (Exception e) {
            logger.error("[file create exception] [the reason for error:{" + e + "}]");
            KafkaConfig.printErrorLog(logger,e);
        }
    }

    public boolean isFileExist() {
        return f.exists();
    }

    public void deleteFile () {
        f.delete();
    }

}
